﻿@inherits BaseComponent

<KLayout @ref="layout" IsAdmin OnLoadMenus="OnLoadMenus" OnReloadPage="OnReloadPage">
    @if (Context.UserSetting.LayoutMode == LayoutMode.Horizontal.ToString())
    {
        <Layout Class="@LayoutClass">
            <div class="@HeaderClass">
                <div class="left">
                    <div class="kui-logo" @onclick="OnLogoClick"></div>
                    <MainMenu @ref="menu" Mode="MenuMode.Horizontal" Parent="root" />
                </div>
                <TopNavbar OnSetting="OnSetting" />
            </div>
            <Content>
                <MainBody @ref="body" ChildContent="ChildContent" />
            </Content>
            <MainFooter />
        </Layout>
    }
    else
    {
        <Layout Class="@LayoutClass">
            @if (Context.UserSetting.LayoutMode == LayoutMode.Float.ToString())
            {
                <Sider Theme="Context.UserSetting.ToSiderTheme()" Class="@MenuClass" CollapsedWidth="60" Collapsed NoTrigger>
                    <div class="kui-logo" @onclick="OnLogoClick"></div>
                    <div class="kui-scroll">
                        <MainMenu @ref="menu" Mode="MenuMode.Inline" Parent="root" />
                    </div>
                </Sider>
            }
            else
            {
                <Sider Theme="Context.UserSetting.ToSiderTheme()" Class="@MenuClass" @bind-Collapsed="collapsed" CollapsedWidth="60" Collapsible NoTrigger>
                    <div class="kui-logo" @onclick="OnLogoClick"></div>
                    <div class="kui-scroll">
                        <MainMenu @ref="menu" Mode="MenuMode.Inline" Parent="root" />
                    </div>
                </Sider>
            }
            <Layout>
                <div class="kui-header">
                    <div class="left">
                        @if (Context.UserSetting.LayoutMode != LayoutMode.Float.ToString())
                        {
                            <NavToggle OnToggle="OnToggle" />
                        }
                        <NavRefresh />
                        <TopBreadcrumb Current="Context.Current" />
                    </div>
                    <TopNavbar OnSetting="OnSetting" />
                </div>
                <Content>
                    <MainBody @ref="body" ChildContent="ChildContent" />
                </Content>
                <MainFooter />
            </Layout>
        </Layout>
    }
</KLayout>